
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[kt_paiba]') AND type IN ('U'))
	DROP TABLE [dbo].[kt_paiba]
GO
CREATE TABLE [dbo].[kt_paiba](
	[user_serial] [bigint] NOT NULL,
	[rq] [nvarchar](7) NOT NULL,
	[d1] [varchar](100) NULL,
	[d2] [varchar](100) NULL,
	[d3] [varchar](100) NULL,
	[d4] [varchar](100) NULL,
	[d5] [varchar](100) NULL,
	[d6] [varchar](100) NULL,
	[d7] [varchar](100) NULL,
	[d8] [varchar](100) NULL,
	[d9] [varchar](100) NULL,
	[d10] [varchar](100) NULL,
	[d11] [varchar](100) NULL,
	[d12] [varchar](100) NULL,
	[d13] [varchar](100) NULL,
	[d14] [varchar](100) NULL,
	[d15] [varchar](100) NULL,
	[d16] [varchar](100) NULL,
	[d17] [varchar](100) NULL,
	[d18] [varchar](100) NULL,
	[d19] [varchar](100) NULL,
	[d20] [varchar](100) NULL,
	[d21] [varchar](100) NULL,
	[d22] [varchar](100) NULL,
	[d23] [varchar](100) NULL,
	[d24] [varchar](100) NULL,
	[d25] [varchar](100) NULL,
	[d26] [varchar](100) NULL,
	[d27] [varchar](100) NULL,
	[d28] [varchar](100) NULL,
	[d29] [varchar](100) NULL,
	[d30] [varchar](100) NULL,
	[d31] [varchar](100) NULL,
	[gly_no] [nvarchar](10) NULL,
	[year] [int] NULL,
	[month] [int] NULL,
PRIMARY KEY CLUSTERED
(
	[user_serial] ASC,
	[rq] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'kt_paiba', @level2type=N'COLUMN',@level2name=N'user_serial'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排班日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'kt_paiba', @level2type=N'COLUMN',@level2name=N'rq'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'd1-d31 表示1号-31号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'kt_paiba', @level2type=N'COLUMN',@level2name=N'd1'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排班人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'kt_paiba', @level2type=N'COLUMN',@level2name=N'gly_no'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'年' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'kt_paiba', @level2type=N'COLUMN',@level2name=N'year'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'月' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'kt_paiba', @level2type=N'COLUMN',@level2name=N'month'
GO

